<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>lay out页面布局</title>
		<script type="text/javascript" src="../js/jquery-1.8.3.js" ></script>
		<script type="text/javascript" src="../js/easyui/jquery.easyui.min.js" ></script>
		<script type="text/javascript" src="../js/easyui/locale/easyui-lang-zh_CN.js" ></script>
		<link rel="stylesheet" href="../js/easyui/themes/default/easyui.css" />
		<link rel="stylesheet" href="../js/easyui/themes/icon.css" />
		<script src="../js/ztree/jquery.ztree.all-3.5.js"  
                               type="text/javascript" charset="utf-8"></script> 
 	 	<link rel="stylesheet" type="text/css" href="../js/ztree/zTreeStyle.css"/> 
		<script>
			$(function(){
				var setting={
				data:{
					simpleData:{
						enable:true
					}
				},
				callback:{
					onClick:function(event, treeId, treeNode) {
							  var content="<div style='width:100%;height:100%;overflow:hidden;''><iframe scrolling='auto' style='width:100%;height:100%;border:0;'src="+treeNode.page+"></iframe></div>"; 
							  alert(content);
							if(treeNode.page!=undefined&&treeNode.page!=""){
								if($("#mytabs").tabs('exists',treeNode.name)){
									 $("#mytabs").tabs('select',treeNode.name);	
								}
								else{
								 $("#mytabs").tabs('add',{
								  	title:treeNode.name,
								  	content:content,
								  	closable :true
								  });
								}
							} 
					 }
					
				}
				
				
			}
		
			var nodes = [
						{id:1, pId:0, name: "父节点1"},
						{id:11, pId:1, name: "子节点1",page:"http://www.itcast.cn"},
						{id:12, pId:1, name: "子节点2",page:"https://www.baidu.com"}
			];
			
			$.fn.zTree.init($("#baseMenu"), setting, nodes);
			
			$("#mytabs").tabs({
				onContextMenu:function(e,title,index){
					// 阻止默认菜单显示
					e.preventDefault();
					//显示自定义右键菜单
					$('#mm').menu('show', { 
					left: e.pageX, 
					top: e.pageY 
					});


				}
				
			
			});
			
			
			});
			
			
			
		</script>
	</head>
	<body class="easyui-layout">
		<div data-options="region:'north'" style="height: 100px;">北部区域</div>
		<div data-options="region:'west'" style="width: 180px;">西部区域
			<div class="easyui-accordion" data-options="fit:true">
				<div data-options="title:'基础菜单'">
					<ul id="baseMenu" class="ztree"></ul>
					
				</div>
			</div>
		</div>
		<div data-options="region:'center'" >中部区域
			<div id="mytabs" class="easyui-tabs" data-options="fit:true">
				<div data-options="title:'选项卡面板1',closable:true">面板1</div>
				<div data-options="title:'选项卡面板2'">面板2</div>
			</div>
		</div>
		<div data-options="region:'east'" style="width: 80px;">东部区域</div>
		<div data-options="region:'south'" style="height: 100px;">南部区域</div>
		<div id="mm" class="easyui-menu" style="width:120px;">
			<div>关闭当前</div>
			<div>关闭其他</div>
			<div class="menu-sep"></div> 
			<div data-options="iconCls:'icon-cancel'">>关闭所有</div>
		</div>
	</body>

